using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using System.Net;
using System.Diagnostics;

namespace NullBrowser
{
    public class UrlRequest
    {
        public static bool Exists(string Url)
        {
            try
            {
                HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create(Url);
                myRequest.Method = "HEAD";
                myRequest.Timeout = 10000;
                HttpWebResponse res = (HttpWebResponse)myRequest.GetResponse();
                return (res.StatusCode == HttpStatusCode.OK);
            }
            catch (System.Net.WebException we)
            {
                //Trace.Write(we.Message);
                return false;
            }
        }
    }
}
